<?php
require_once 'Junction/Builder/Definition.php';
require_once 'Junction/Builder/Property.php';
require_once 'Junction/Utils/Xml/Exception.php';
require_once 'Junction/Utils/Xml/Handler.php';
require_once 'Junction/Utils/Xml/Parser.php';


class Junction_Builder_Handlers_Property implements Junction_Utils_Xml_Handler {
	
	/**
	 * @throws Junction_Utils_Xml_Exception
	 *
	 * @param SimpleXMLElement $root
	 * @return Junction_Builder_Property
	 */
	public function handle(SimpleXMLElement $root) {
	    $attrs = Junction_Utils_Xml_Parser::collectAttributes($root);
		return new Junction_Builder_Property($attrs[Junction_Builder_Definition::nameAttribute], 
		    $attrs[Junction_Builder_Definition::columnAttribute]); 
	}
}
?>